package com.slg.android.manyanime;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

import com.lidroid.xutils.BitmapUtils;
import com.slg.android.manyanime.bean.CoserPicture;
import com.slg.android.manyanime.utils.DataStore;

import java.io.Serializable;


public class CoserDetailActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_coser_detail);

        Intent intent = getIntent();
        Serializable bitmap = intent.getSerializableExtra("bitmap");
        TextView textView = (TextView)findViewById(R.id.coser_detail_activity_title_txt);

        ImageView imageView = (ImageView) findViewById(R.id.coser_detail_activity_image);
        if(bitmap instanceof CoserPicture){
            String pic = ((CoserPicture) bitmap).getPic();
            BitmapUtils bitmapUtils = DataStore.getBitmapUtils();
            bitmapUtils.configDefaultLoadFailedImage(R.drawable.cartoon_hot_loading);
            bitmapUtils.configDefaultLoadingImage(R.drawable.cartoon_hot_loading);
            textView.setText(((CoserPicture) bitmap).getName());
            bitmapUtils.display(imageView, pic);
        }



    }


}
